require(['/js/config.js'],() =>{
	require(['template','swiper','header','footer'],(template, Swiper)=>{
		class Index {
			constructor() {
				
				console.log(1)
			    this.banner()
				this.getList()
			}
			banner(){
				var mySwiper = new Swiper('#banner', {
				    loop: true,
					autoplay: true,
				    pagination: {
				      el: '.banner-pagination',
					  clickable :true,
				    },
				    navigation: {
				      nextEl: '#banner .swiper-button-next',
				      prevEl: '#banner .swiper-button-prev'
				    },
				})
			}
			getList () {
				const id = location.search.slice(4)
				$.get(`http://www.xiongmaoyouxuan.com/api/search`, {
					word:"面包",
					start:0,
					sort:0,
					couponOnly:NaN,
					minPrice:0,
					maxPrice:99999
				},resp => {
					console.log(resp)
					if (resp.code === 200) {
						const { list } = resp.data
						console.log(list)
						$('#goodsClassify').html(
							template('classifyTempalte',{
								list
							})
						)
					}
				})
			}
		}
		new Index()
	})
})